feat: per-wallet mail text overrides for RealUnit#3639
Closed
TaprootFreak wants to merge 1 commit intodevelopfrom
Closed
feat: per-wallet mail text overrides for RealUnit#3639TaprootFreak wants to merge 1 commit intodevelopfrom
TaprootFreak wants to merge 1 commit intodevelopfrom
Conversation
Make MailFactory.translate wallet-aware: when a wallet is attached to the mail request, look up `mail.wallets.<walletname>.<key>` first and fall back to the default key. Propagate walletName through getMailAffix, mapMailAffix and translateParams so all i18n lookups in user-V2 and personal mails respect the override. Add RealUnit override block to de/en mail.json covering closing/support/ welcome/thanks plus subjects and salutations for purchase, sale, refund, KYC and email-verification flows. Texts use formal "Sie" address and RealUnit branding. Add realUnit.hbs as RealUnit-branded mail template (logo swap, otherwise identical to onChainLabs layout) and switch the RealUnit wallet config to use it.
Collaborator
Author
|
Doppelarbeit — wird ersetzt durch den älteren Draft-PR #3598 (feat/realunit-mail-template), der bereits weiter gediehen ist (separate mail-realunit.json, body-text-injection in der Factory, Preview-Script). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds per-wallet override mechanism for user-mail texts so partner wallets (RealUnit being the first) can ship their own subjects, salutations and body texts without forking the trigger services or introducing new MailType values.
What changed
MailFactory.translate(...)is now wallet-aware. When awalletNameis passed it triesmail.wallets.<walletname>.<key>first and falls back to the default key.getMailAffix,mapMailAffixandtranslateParamspropagate thewalletName, andcreateUserV2Mail/createPersonalMailpull it fromwallet.nameautomatically.mail.json(DE + EN) gets a newwallets.realunitblock with overrides forgeneral(closing / support / welcome / thanks), purchase / sale / refund / processing flows plus KYC failure, missing-data, reminder, and email-verification reminder. All texts use formal Sie and the RealUnit Schweiz AG closing.realUnit.hbsmail layout (copy ofonChainLabs.hbswith RealUnit logo URL swapped). Layout/colors are unchanged for now — RealUnit branding can be tuned in a follow-up once they hand over the assets.config.tsflipsmail.wallet.RealUnit.templatefrom'user-v2'to'realUnit'.What this maps to (RealUnit template doc v1.1)
BUY_CRYPTO_COMPLETEDpayment.crypto_output.*BUY_FIAT_PROCESSINGpayment.processing.*BUY_FIAT_PENDINGpayment.chargeback.reasons.monthly_limitBUY_FIAT_PENDINGpayment.chargeback.reasons.annual_limitBUY_CRYPTO_PENDINGpayment.fiat_input.*KYC_FAILEDkyc.failed.*KYC_MISSING_DATAkyc.missing_data.*EMAIL_VERIFICATION_REMINDERverification_code.email.*KYC_REMINDERkyc.reminder.*BUY_FIAT_RETURNpayment.chargeback.fiat.*BUY_FIAT_RETURNpayment.chargeback.crypto.*BUY_FIAT_COMPLETEDpayment.fiat_output.*#6 (Zahlungsproblem) and #13 (Aktion ausstehend) are intentionally NOT overridden — they should be disabled per-wallet via
wallet.disabledMailTypesonce this lands.Open points (waiting on RealUnit / DAS)
https://support.realunit.ch.Test plan
kyc.reminder.titleandgeneral.supportcome from the override block.Out of scope
MailFactorybeyond the override hook.MailTypeorMailContextvalues.